#ifndef SENDABLE_H
#define SENDABLE_H

#include "send_impl.h"

#include <boost/shared_ptr.hpp>

#include <string>
using namespace std;

namespace network {
	class sendable {
	public:
		sendable(boost::shared_ptr<network::send_impl> impl);
		virtual ~sendable() {}

		virtual string get_string() = 0;
	protected:
		void create_open_object(const string &name) 
		{
			_impl->create_open_object(name);
		}
		void create_close_object(const string &name)
		{
			_impl->create_close_object(name);
		}
		void create_single_object(const string &name)
		{
			_impl->create_single_object(name);
		}
		void create_attrib(const string &name, 
				   const string &val)
		{
			_impl->create_attrib(name, val);
		}

		const string& get_header()
		{
			return _impl->get_header();
		}
		const string& get_footer() 
		{
			return _impl->get_footer();
		}
		boost::shared_ptr<network::send_impl> get_impl()
		{
			return _impl;
		}
	private:
		boost::shared_ptr<network::send_impl> _impl;
	};
}

#endif
